package com.drojian.demo2.cartoon;

import android.os.Bundle;
import android.view.View;
import android.view.animation.Animation;
import android.view.animation.AnimationUtils;
import android.widget.ImageView;
import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import com.drojian.demo.R;

public class InterstitialCartoonActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        EdgeToEdge.enable(this);
        setContentView(R.layout.part2_activity_interstitial_cartoon);

        ImageView interstitial1 = findViewById(R.id.interstitial1);
        interstitial1.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Animation animation = AnimationUtils.loadAnimation(
                        InterstitialCartoonActivity.this, R.anim.alpha);
                interstitial1.startAnimation(animation);
            }
        });

        ImageView interstitial2 = findViewById(R.id.interstitial2);
        interstitial2.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Animation animation = AnimationUtils.loadAnimation(
                        InterstitialCartoonActivity.this, R.anim.rotate);
                interstitial2.startAnimation(animation);
            }
        });

        ImageView interstitial3 = findViewById(R.id.interstitial3);
        interstitial3.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Animation animation = AnimationUtils.loadAnimation(
                        InterstitialCartoonActivity.this, R.anim.scale);
                interstitial3.startAnimation(animation);
            }
        });

        ImageView interstitial4 = findViewById(R.id.interstitial4);
        interstitial4.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                Animation animation = AnimationUtils.loadAnimation(
                        InterstitialCartoonActivity.this, R.anim.translate);
                interstitial4.startAnimation(animation);
            }
        });
    }
}